<?php

use think\facade\Route;

Route::post(":version.login", ':version.Login/doLogin');
Route::post(":version.import_excel", ':version.TemplateCon/importExcel');
Route::get(":version.test", ':version.FolderCon/getProjectGatherFileInfo');
Route::group(':version.admin', function () {
    //获取用户信息
    Route::get("admin_show", ':version.Login/adminShow');
    //用户列表
    Route::get('admin_list', ':version.Admin/adminList');
    //用户更新
    Route::get('update_show/:id', ':version.Admin/adminUpdateShow');
    //用户保存
    Route::post('admin_save', ':version.Admin/adminSave');
    //删除用户
    Route::get('admin_delete/:id', ':version.Admin/adminDelete');

    //新增and编辑角色
    Route::post('save_role', ':version.Role/saveRole');
    //获取菜单权限
    Route::get('permission', ':version.Menu/menuPermission');
    //新增and编辑菜单
    Route::post('save_menu', ':version.Menu/saveMenu');
    //删除菜单
    Route::delete('del_menu/:id', ':version.Menu/delMenu');
    //菜单列表
    Route::get('menu_list', ':version.Menu/MenuInfo');
    //获取角色列表
    Route::get('role_list', ':version.Role/roleList');
    //删除角色
    Route::delete('del_role/:id/:role_id', ':version.Role/delRole');
    //删除角色组
    Route::delete('del_group/:id', ':version.Role/groupDel');
    //更改角色状态
    Route::put('update_role_status/:id/:status', ':version.Role/updateRoleStatus');
    //读取所有角色
    Route::get('role_info_list', ':version.Role/roleInfoList');
    //保存中间表角色
    Route::post('set_role_user_pivot', ':version.Role/setRoleUserPivot');
    //获取菜单类别
    Route::get('menu_type', ':version.Menu/MenuType');
    //根据父级节点获取对应的权限菜单
    Route::post('allot_menu_auth', ':version.Role/allotMenuAuth');

    //数据源
    Route::get('wechat_list', ':version.User/wechatList');
    //微信前端用户
    Route::post("wechat_save", ':version.User/wechatSave');
    //删除
    Route::delete('wechat_delete/:id', ':version.User/wechatDelete');


    //模版列表
    Route::get('template_list', ':version.TemplateCon/templateList');
    //模版样本列表
    Route::get('template_sample_list', ':version.TemplateCon/templateSampleList');

    //保存模版
    Route::post('save_template', ':version.TemplateCon/saveTemplate');
    //保存样本点模版
    Route::post('save_sample_template', ':version.TemplateCon/saveSampleTemplate');

    //删除模版
    Route::delete('template_delete/:id', ':version.TemplateCon/templateDel');
    //删除模版样本点
    Route::delete('template_sample_delete/:id', ':version.TemplateCon/templateSampleDel');
    //导入模版数据
    Route::post("import_excel", ':version.TemplateCon/importExcel');
    //导入模版样本
    Route::post("import_sample_excel", ':version.TemplateCon/importSampleExcel');

    //监测问卷下是否有数据
    Route::get('check_question/:id', ':version.TemplateCon/checkQuestion');
    //根据模版id 获取对应的分类
    Route::get('template_type_list', ':version.TemplateCon/templateTypeList');
    //修改模版详情
    Route::post("update_detail_template", ':version.TemplateCon/updateDetailTemplate');
    //修改模版大类别
    Route::post("update_template", ':version.TemplateCon/updateTemplate');
    //修改模版二级类别
    Route::post("update_second_level", ':version.TemplateCon/updateSecondLevel');
    //
    Route::post("get_two_template", ':version.TemplateCon/getTwoTemplate');

    //新增
    Route::post("add_template", ':version.TemplateCon/addTemplate');
    //下载数据模板文件
    Route::get('download_file', ':version.TemplateCon/downloadFile');
    //select 读取
    Route::get("get_template_select", ':version.TemplateCon/getTemplateSelect');
    //生成项目
    Route::post("save_project_all", ':version.ProjectCon/saveProjectAll');
    //项目列表
    Route::get("get_project_list", ':version.ProjectCon/getProjectList');
    //删除项目
    Route::delete("project_delete/:id", ':version.ProjectCon/delProject');
    //编辑项目
    Route::post("save_project", ':version.ProjectCon/saveEditProject');
    //监测问卷下是否有数据
    Route::get('check_project/:id', ':version.ProjectCon/checkProject');
    //根据项目id 获取对应的分类
    Route::get('project_type_list', ':version.ProjectCon/projectTypeList');
    //修改项目的二级指标
    Route::post("update_project_second_level", ':version.ProjectCon/updateProjectSecondLevel');
    //修改项目的一级分类
    Route::post("update_project_type", ':version.ProjectCon/updateProjectType');
    //修改项目细则指标
    Route::post("update_detail_project", ':version.ProjectCon/updateProjectDetail');

    //责任单位
    Route::get('duty_unit_list', ':version.DutyUnitCon/dutyUnitList');
    //保存责任单位
    Route::post("save_duty_unit", ':version.DutyUnitCon/saveDutyUnit');
    //删除责任单位
    Route::delete("unit_delete/:id", ':version.DutyUnitCon/unitDelete');

    //项目样本点
    Route::get('project_sample_list', ':version.ProjectSampleCon/getProjectSampleList');
    //根据项目id获取对应的一级指标
    Route::get("get_project_type_list", ':version.DataCenter/getProjectTypeList');
    //保存项目样本点
    Route::post("add_project_sample", ':version.ProjectSampleCon/saveProjectSample');
    //删除项目样本点
    Route::delete("sample_delete/:id", ':version.ProjectSampleCon/delProjectSample');
    //文件夹
    Route::get('project_folder_list', ':version.FolderCon/getFolderList');
    //文件列表
    Route::get('gather_file_list', ':version.FolderCon/getGatherFileList');
    //获取对应的文件夹
    Route::post('folder_one_info', ':version.FolderCon/getFolderOneInfo');
    //根据条件获取对应的二级指标
    Route::get("get_project_second_level_list", ':version.DataCenter/getProjectSecondLevelList');
    //获取详细指标
    Route::get("get_project_detail", ':version.FolderCon/getProjectDetail');
    //采集列表
    Route::get("get_gather_file_info", ':version.FolderCon/getProjectGatherFileInfo');
    //保存审核结果
    Route::post('save_audit_result', ':version.FolderCon/saveAuditResult');
    //删除采集信息
    Route::post('del_gather_file', ':version.FolderCon/delGatherFile');
    //读取所有项目级下级内容
    Route::get("project_select_all", ':version.FolderCon/getProjectSelectAll');
    //根据项目id获取对应的一级指标
    Route::get("project_id_folder", ':version.FolderCon/getProjectIdFolder');
    //获取对应的样本点
    Route::get("project_sample_info", ':version.FolderCon/getSampleInfo');
    //保存转移文件
    Route::post('save_move_file', ':version.FolderCon/saveMoveFile');
    //获取采集详情
    Route::post("gather_file_detail", ':version.FolderCon/gatherFileDetail');
    //删除文件夹
    Route::post("del_folder", ':version.FolderCon/delFolder');
    //导图到压缩包
    Route::post("import_img_zip", ':version.FolderCon/importImgZip');
    //采集列表
    Route::get("get_gather_list", ':version.Gather/getGatherList');
    //获批量保存数据
    Route::post('operation_save_gather', ':version.DataCenter/operationSaveGather');
    //采集列表
    Route::get("select_user_list", ':version.User/selectUserAllList');


})->middleware(\app\api\middleware\v1\AuthAdmin::class);
//微信不验证
Route::group(':version/wx',function (){
    //微信用户登录
    Route::post('wx_login', ':version.User/wxLogin');
});

//验证
Route::group(':version/auth_wx',function (){
    //项目列表
    Route::get("get_project_list", ':version.ProjectCon/getProjectList');
    //根据项目id获取对应的一级指标
    Route::get("get_project_type_list", ':version.DataCenter/getProjectTypeList');
    //根据项目一级指标获取对应的样本点
    Route::get("get_project_sample_list", ':version.DataCenter/getProjectSampleList');
    //微信端自定义创建样本点
    Route::post("custom_create_sample", ':version.DataCenter/customCreateSample');
    //创建项目样本点文件夹
    Route::post("create_project_folder", ':version.DataCenter/createProjectFolder');
    //获取文件夹列表
    Route::get("get_project_folder", ':version.DataCenter/getProjectFolderList');
    //上传照片
    Route::post("save_img", ':version.DataCenter/saveImg');
    //保存采集上传信息
    Route::post("save_gather_img", ':version.DataCenter/saveGatherFileImg');
    //图片库
    Route::get("get_photo_library_list", ':version.DataCenter/getPhotoFolderList');
    //根据条件获取对应的二级指标
    Route::get("get_project_second_level_list", ':version.DataCenter/getProjectSecondLevelList');
    //保存分配指标
    Route::post("save_allot_gather", ':version.DataCenter/saveAllotGather');
    //重新保存分配指标
    Route::post("again_save_allot_gather", ':version.DataCenter/againSaveAllotGather');
    //获取详细指标
    Route::get("get_project_detail", ':version.FolderCon/getProjectDetail');
    //获取对应的文件夹
    Route::post('folder_one_info', ':version.FolderCon/getFolderOneInfo');
    //获批量保存数据
    Route::post('operation_save_gather', ':version.DataCenter/operationSaveGather');
    //复用保存数据
    Route::post('reuse_save_gather', ':version.DataCenter/reuseSaveGather');
    //删除文件夹
    Route::post("del_folder", ':version.FolderCon/delFolder');

})->middleware(\app\api\middleware\v1\WxAuth::class);
